<?php
require_once("lib/db_connection.php");
require_once("vcl/vcl.inc.php");
//Includes
use_unit("components4phpfull/jtjavascript.inc.php");
use_unit("components4phpfull/jtcheckboxlist.inc.php");
use_unit("components4phpfull/jtiframe.inc.php");
use_unit("components4phpfull/jtpagecontrol.inc.php");
use_unit("components4phpfull/jtsitetheme.inc.php");
use_unit("forms.inc.php");
use_unit("extctrls.inc.php");
use_unit("stdctrls.inc.php");

//Class definition
class trouble_workorder_list extends Page
{
       public $lblmodel = null;
       public $lblmake = null;
       public $Label43 = null;
       public $Label38 = null;
       public $lblyear = null;
       public $lblplate = null;
       public $lblEmpName = null;
       public $lblEmpId = null;
       public $workorder_open_create = null;
       public $Image1 = null;
       public $imgBack = null;
       public $Label48 = null;
       public $lblVeh = null;
       public $hfVehId = null;
       public $JTFrameWorkorder = null;
       public $JTPageControl = null;
       public $JTFrameTrouble = null;
       public $JTSiteTheme1 = null;
       function imgBackJSMouseOut($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgBack'].src="image/btn_back.png"
       <?php

       }

       function imgBackJSMouseOver($sender, $params)
       {

       ?>
       //Add your javascript code here
       document.images['imgBack'].src="image/btn_back2.png"
       <?php

       }

       function trouble_workorder_listCreate($sender, $params)
       {
       $this->imgBack->setLink('vehicle_list.php?company='.$_SESSION['company_id']);


       }




       function trouble_workorder_listShow($sender, $params)
       {
       $veh_id = $_GET['veh_id'];
       $layer = $_GET['layer'];
       if($veh_id!='' && $veh_id!=null)
       $this->hfVehId->setValue($veh_id);
       $this->JTPageControl->setTabIndex($layer);

       $query_vin = "SELECT * FROM vehicle_tbl WHERE vehicle_id='".$this->hfVehId->getValue()."'";
       $result_vin = mysql_query($query_vin) or die("SELECT VEH INFO ".mysql_error());
       $row_selected = mysql_fetch_array($result_vin);
       $label = $row_selected['VIN'];
       $this->lblVeh->Caption = $label;
       $this->lblyear->Caption = $row_selected['year'];
       $this->lblmake->Caption = $row_selected['manufacturer_name'];
       $this->lblmodel->Caption = $row_selected['model_name'];
       $this->lblplate->Caption = $row_selected['veh_num'];

       $this->JTFrameTrouble->setURL('veh_trouble_list_frame.php?veh_id='.$this->hfVehId->getValue());
       $this->JTFrameWorkorder->setURL('veh_workorder_list_frame.php?veh='.$this->hfVehId->getValue());
       }

}

global $application;

global $trouble_workorder_list;

//Creates the form
$trouble_workorder_list=new trouble_workorder_list($application);

//Read from resource file
$trouble_workorder_list->loadResource(__FILE__);

//Shows the form
$trouble_workorder_list->show();

?>